{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}

{%- macro social_link(symbol, url, title, link_text) -%}
    <a class="sociallink" href="{{url}}"
       title="{{title}}">
      <i class="fa {{symbol}} fa-lg"></i>
      {%- if link_text -%} {{link_text}}{%- endif -%}
    </a>
{%- endmacro -%}

{%- set rss_link_text = rss_link_text is not defined and None or rss_link_text -%}

{%- macro twitter_link() -%}
    {{ social_link('fa-twitter', 'http://www.twitter.com/pymotw', 'Twitter', None) }}
{%- endmacro -%}

{%- macro rss_link() -%}
{{ social_link('fa-rss-square', 'http://feeds.doughellmann.com/PyMOTW', "Subscribe via RSS", rss_link_text) }}
{%- endmacro -%}

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">

    {%- block htmltitle %}
    <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
    {%- endblock %}

    <link rel="stylesheet" href="{{ pathto('_static/pure-min.css', 1) }}" type="text/css">
    <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
    <link rel="stylesheet" href="{{ pathto('_static/font-awesome/css/font-awesome.min.css', 1) }}" type="text/css" />
    <link rel="stylesheet" href="{{ pathto('_static/pymotw.css', 1) }}" type="text/css">

    <link rel="shortcut icon" type="image/png" href="{{ pathto('_static/favicon.png', 1) }}">

    <link rel="alternate" type="application/atom+xml"
          title="Doug Hellmann"
          href="http://feeds.doughellmann.com/DougHellmann" />
    <link rel="alternate" type="application/atom+xml"
          title="PyMOTW Updates"
          href="http://feeds.doughellmann.com/PyMOTW" />

    <meta name="verify-v1" content="5saTcOa2HLac4V85yUg3SARfun1PqT5Upu7IR/6fpv4="/>

    <meta name="twitter:card" content="summary" />
    <meta name="twitter:site" content="@pymotw" />
    <meta name="twitter:title" content="{{ title|striptags|e }}" />
    <meta name="twitter:image" content="https://pymotw.com/3/_static/logo-large.png" />

  </head>
  <body>

    <div class="pure-menu pure-menu-open pure-menu-horizontal" id="site-menu">
      <a class="pure-menu-heading" href="{{ pathto(master_doc) }}"><img src="{{ pathto('_static/logo.png', 1) }}"> PyMOTW-3</a>

      <ul id="top-menu">
        <li class="pure-menu-selected"><a href="{{ pathto('py-modindex') }}"><i class="fa fa-list fa-lg"></i> Module Index</a></li>
        <li class="pure-menu-selected"><a href="{{ pathto('genindex') }}"><i class="fa fa-italic fa-lg"></i> Index</a></li>
        <li class="pure-menu-selected">{{ twitter_link() }}</a>
        <li class="pure-menu-selected">{{ rss_link() }}</li>
      </ul>

    </div>

    <div class="pure-menu pure-menu-open pure-menu-vertical" id="breadcrumbs-menu">
      {# Always leave the UL present, even if we don't put anything in
         it, to ensure the menubar height is calculated properly. #}
      <ul id="breadcrumbs">
        {%- for parent in parents %}
        <li class="pure-menu-selected"><a href="{{ parent.link|e }}"><i class="fa fa-arrow-circle-up"></i> {{ parent.title }}</a></li>
        {%- endfor %}
      </ul>
    </div>

    <div class="pure-g-r" id="content-container">

      <div class="pure-u-3-4">
        <div class="content">
          {% block body %}
          {% endblock %}

        <div id="footer-nav">
{%- if prev %}
<a id="prev-link" href="{{ prev.link|e }}"
   title="{{ _('previous chapter') }}"><i class="fa fa-arrow-circle-left"></i> {{ prev.title }}</a>
{%- endif %}
{%- if next %}
<a id="next-link" href="{{ next.link|e }}"
   title="{{ _('next chapter') }}">{{ next.title }} <i class="fa fa-arrow-circle-right"></i></a>
{%- endif %}
        </div>

        </div>
      </div>

      <div class="pure-u-1-4">
        <div class="sidebar-wrapper">

          {%- for sidebartemplate in sidebars %}
          <div class="sidebar">
            {%- include sidebartemplate %}
          </div>
          {%- endfor %}

        </div>
      </div>

    </div>

    <div class="pure-g-r" id="footer">

      <div class="pure-u-1-3">
        <div class="footer-list">
            <h4>This Site</h4>
            <ul>
              <li><a href="{{ pathto('py-modindex') }}"><i class="fa fa-list fa-lg"></i> Module Index</a></li>
              <li><a href="{{ pathto('genindex') }}"><i class="fa fa-italic fa-lg"></i> Index</a></li>
            </ul>
        </div>
      </div> {#- 1-3 -#}

        <div class="pure-u-1-3">
          <div class="footer-content">
            <div class="socialmedia">
              {{ social_link('fa-home', pathto(master_doc), 'Home', None) }}
              {{ social_link('fa-user', pathto('about'), 'About', None) }}
              {{ twitter_link() }}
              {{ rss_link() }}
              {{ social_link('fa-envelope', 'http://feedburner.google.com/fb/a/mailverify?uri=PyMOTW&amp;loc=en_US', 'Subscribe via Email', None) }}
            </div>

            <div class="copyright">
              <a rel="author" href="{{ pathto('about') }}">&copy; Copyright {{ copyright }}</a>
            </div>

            <div class="cc">
              {#- <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_US" rel="license"><img alt="Creative Commons License BY-NC-SA" style="border-width:0; align: center;" width="88" height="31" src="{{ pathto('_static/cc-40-by-nc-sa.png', 1) }}"/></a> -#}
              <a href="http://creativecommons.org/licenses/by-nc-sa/4.0/deed.en_US" rel="license"><img alt="Creative Commons License BY-NC-SA" style="border-width:0; align: center;" width="88" height="31" src=""/></a>
            </div>

          </div> {#- footer-content -#}
        </div> {#- 1-3 -#}

        <div class="pure-u-1-3">
          <div class="footer-list">
            <h4>Other Writing</h4>
            <ul>
              <li><a href="https://doughellmann.com/"><i class="fa fa-pencil fa-lg"></i> Blog</a></li>
              <li><a href="https://doughellmann.com/books/the-python-3-standard-library-by-example/"><i class="fa fa-book fa-lg"></i> The Python Standard Library By Example</a></li>
            </ul>
          </div>
        </div> {#- 1-3 -#}

<script type="text/javascript">
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-38546875-3', 'pymotw.com');
  ga('send', 'pageview');
</script>

  </body>
</html>
